package com.xbongbong.parent.interfaces;

import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.pojo.dto.FormDataListDTO;
import com.xbongbong.paas.pojo.dto.ValidateDataDTO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.detailtab.dto.team.TeamDetailDTO;
import com.xbongbong.pro.detailtab.dto.team.TeamDetailEditLabelDTO;
import com.xbongbong.pro.detailtab.dto.team.TeamDetailUpdateDTO;
import com.xbongbong.pro.detailtab.vo.team.TeamDetailEditCoPerVO;
import com.xbongbong.pro.detailtab.vo.team.TeamDetailEditLabelVO;
import com.xbongbong.pro.detailtab.vo.team.TeamDetailVO;
import com.xbongbong.pro.detailtab.vo.team.TeamListBatchPermissionVO;
import com.xbongbong.pro.formdata.pojo.AfterSavePojo;
import com.xbongbong.pro.formdata.pojo.SaasNeedRedundantAttrPojo;
import com.xbongbong.pro.listbatch.pojo.TeamBatchPojo;
import com.xbongbong.pro.team.TeamAfterVerifyDTO;
import com.xbongbong.pro.team.TeamVerifyDTO;

import java.util.List;

/**
 * 团队成员 处理 策略
 * @author 魏荣杰
 *
 */
public interface TeamStrategy {

    /**
     * 团队校验方法
     * @param validateDataDTO
     * @throws XbbException
     */
    void beforeVerifyUserTeam(ValidateDataDTO validateDataDTO) throws XbbException;

    /**
     *
     * @param teamVerifyDTO
     * @return
     * @throws XbbException
     */
    List<TeamBatchPojo> save(TeamVerifyDTO teamVerifyDTO) throws XbbException;
    /**
     * 团队保存方法
     *
     * @param saasNeedRedundantAttrPoJo
     * @param dataId
     * @param newPaasFormDataEntity
     * @param isImport
     * @param workflowTag
     * @return
     * @throws XbbException
     */
    AfterSavePojo saveUserTeam(SaasNeedRedundantAttrPojo saasNeedRedundantAttrPoJo, Long dataId, PaasFormDataEntity newPaasFormDataEntity, Integer isImport, Boolean workflowTag) throws XbbException;

    /**
     * Description: 团队成员业务类型
     * @author 魏荣杰
     * @date 2021/12/23 14:43
     * @return
     */
    List<Integer> type();



    /**
     * Description: 团队校验
     * @author 魏荣杰
     * @date 2021/12/23 16:55
     * @param teamVerifyDTO
     * @return
     * @throws XbbException
     */
    TeamAfterVerifyDTO verify(TeamVerifyDTO teamVerifyDTO) throws XbbException;

    /**
     * Description: 团队的特殊校验（目前只有客户，线索业务的公海池规则校验）
     * @param teamAfterVerifyDTO
     * @return com.xbongbong.pro.team.TeamAfterVerifyDTO
     * @throws
     * @author 魏荣杰
     * @date 2022/3/21 11:25
     * @since
     */
    TeamAfterVerifyDTO specialVerify(TeamAfterVerifyDTO teamAfterVerifyDTO) throws XbbException;

    /**
     * Description: 团队保存
     * @author 魏荣杰
     * @date 2021/12/23 16:56
     * @param teamAfterVerifyDTO
     */
    void save(TeamAfterVerifyDTO teamAfterVerifyDTO) throws XbbException;

    /**
     * Description: 团队保存后的关联业务处理
     * @param teamAfterVerifyDTO
     * @return void
     * @throws
     * @author 魏荣杰
     * @date 2022/1/5 17:04
     * @since
     */
    void afterSave(TeamAfterVerifyDTO teamAfterVerifyDTO) throws XbbException;

    /**
     * Description: 日志
     * @param teamAfterVerifyDTO
     * @return void
     * @throws
     * @author 魏荣杰
     * @date 2022/1/5 18:21
     * @since
     */
    void log(TeamAfterVerifyDTO teamAfterVerifyDTO) throws XbbException;

    /**
     * 团队详情tab栏信息
     *
     * @param teamDetailDTO
     * @return
     */
    TeamDetailVO detail(TeamDetailDTO teamDetailDTO) throws XbbException;


    /**
     * 团队详情编辑协同人权限
     *
     * @param teamDetailUpdateDTO
     * @return
     * @throws XbbException
     */
    TeamDetailEditCoPerVO editCoPermission(TeamDetailUpdateDTO teamDetailUpdateDTO) throws XbbException;

    /**
     * 编辑团队成员标签
     *
     * @param teamDetailEditLabelDTO 编辑团队成员标签的接收实体
     * @return
     */
    TeamDetailEditLabelVO editLabel(TeamDetailEditLabelDTO teamDetailEditLabelDTO) throws XbbException;

    /**
     * 获取业务列表中与团队有关的一些批量操作的权限
     *
     * @param formDataListDTO 列表实体
     * @return
     */
    TeamListBatchPermissionVO getTeamListBatchPermission(FormDataListDTO formDataListDTO, List<FieldAttrEntity> explains) throws XbbException;
}
